package com.aaa.sbms.controller;

import com.aaa.sbms.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("emp")
public class EmpController {

    @Autowired(required = false)
    private EmpService empService;

    @RequestMapping("depts")
    public Map depts(){
        return empService.depts();
    }

    /**
     * 分页查询员工信息
     * @param map
     * @return
     */
    @RequestMapping("empPage")
    public Map empPage(@RequestParam Map map){
        return empService.empPage(map);
    }

    /**
     * 分页查询员工打卡信息
     * @param map
     * @return
     */
    @RequestMapping("empSignPage")
    public Map empSignPage(@RequestParam Map map){
        return empService.empSignPage(map);
    }

    /**
     * 根据员工编号查询该员工信息
     * @param userid
     * @return
     */
    @RequestMapping("empOne")
    public Map empOne(Integer userid){
        return empService.empOne(userid);
    }
}
